The present invention relates to a method for managing a real-time system in general and to a method for managing real-time communication processing in particular.
Methods for managing and controlling real-time systems are known in the art. A real time system often executes several tasks, at the same time, and it often has to finish executing each of them within a predetermined period of time. Thus, the real-time system has to monitor the progress in execution of each of the tasks and provides resources thereto, accordingly.
If the execution of a task does not progress in a way that the task shall be completed in the given period of time assigned thereto, then the real-time system may increase the number and volume of the resources assigned to this task.
For example, the prediction for a task is that it would require 10 million CPU operations (also called instructions). The time period determined for this task is 2 seconds. The clock of the CPU is set to 50 million instructions/second (MIPS). Thus, the system assigns 5 MIPS to this task, which are 10% of the CPUs"" power according to the current clock setting.
While executing the task, after one second has passed, the system detects that this task would require 20 million CPU operations. Hence, there is a single second left to complete the executing of the task, in which 15 million CPU operations have to be performed.
Accordingly, if the rest of the tasks processed by the CPU require less than 35 MIPS, then the system assigns the remaining 15 MIPS to this task.
It will be appreciated that if the system had 15 MIPS available then, the overall efficiency of the system at that time is 70%. Many real-time systems, being aware that they may need extra processing power, reserve a considerable portion of their resources for crisis situations such as described above. Hence, these systems become less efficient.
Another way to provide the task with 15 MIPS is for the system to initially set the clock of the CPU to a higher frequency, In the present example, since the task uses 10% of the processing power of the CPU, the clock of the CPU has to be set to 100 MIPS, which is twice as high as the current setting. By doing so, the system has to operate constantly under a high frequency, which results in a higher power consumption, This aspect is especially critical in systems which have limited power sources such as cellular telephones, pagers and the like. The object of these systems is to reduce power consumption, thereby prolonging the use of their limited power sources.
It will be appreciated that any increase in clock frequency requires an increase of the electrical power which is supplied to the CPU. This aspect is especially critical for apparatus which have limited power sources, such as battery operated devices.
It will also be appreciated that real time systems which run a single task at a time do not have the ability to shift resources between tasks. All of the resources of the system are devoted to the single task and so, a considerable margin has to taken into account when attempting to forecast an outstanding situation which may require more processing resources than normal operation.
A real time system may often encounter low power tasks which require less resources than those available. It will be appreciated that in these cases, the remaining resources, beyond the requirements of a low task, are not used and are, thereby, wasted.
In cellular telephone devices, a considerable reduction of the operating frequency is called sleep mode. In sleep mode, only a selected group of low power tasks may run. Sleep mode is used when the cellular telephone is not in use (i.e. waiting for an incoming call). It will be appreciated that a cellular telephone can not fully operate In sleep mode.
It is an object of the present invention to provide a novel method for providing an efficient management of real-time processing.
According to the present invention there is thus provided a system for real time processing of at least one real-time software application, wherein the processing of at least a selected one of the at least one real-time software application is according to a predetermined complexity level and has to be completed at a predetermined point in time TE.
The system includes at least one processing unit for processing the least one real-time software application, a system clock for timing the at least one processing unit, connected to the processing unit and a processing controller connected to the at least one processing unit and to the system clock.
The processing controller controls the complexity level of the selected software application. The processing controller also detects the extent of progress in processing the selected real-time software application by the at least one processing unit, determines an estimated point in time TC whereby the processing unit is likely to complete processing the selected real-time software application and provides a command to reduce the complexity level to the processing unit when the estimated point in time TC is grater than the point in time TE.
The processing controller also controls the frequency produced by the system clock, so as to increase or decrease it.
According to one aspect of the invention, the processing controller includes a memory unit, a real-time clock connected to the memory unit and a processor connected to the memory unit and the real-time clock. The processor receives processing progress indications from the processing unit. The real-time clock detects the frequency produced by the system clock and generates a corresponding time indication for each the processing progress indication. The processor stores each the processing progress indication and the corresponding time indication as a data entry in the memory unit.
The processor determines a prediction of a point in time wherein the processing unit is likely to complete processing the task.
According to another aspect of the invention, there is thus provided a method for managing and controlling the system of the invention, operating according to a predetermined system clock frequency value F. The system processes a real-time task according to a complexity value C and has to complete processing the real-time task by a time point TE. The method including the steps of:
detecting the system clock frequency value F thereby determining a processing rate;
detecting progress in processing the at least one real-time task;
determining a predicted time point T1 from the progress and the processing rate by which the system should complete processing the at least one real-time task;
determining a complexity level decrease value CSTEP, whereby according to a complexity level of Cxe2x88x92CSTEP, the system is likely to complete processing the at least one real-time task, when the predicted time point T1 is greater than the time point TE;
subtracting the complexity level decrease value CSTEP from the complexity level value C and providing the complexity level to the system; and
repeating from the step of detecting the system clock frequency value F.
When the complexity value C is limited by a predetermined minimal complexity value CMIN, the method including the steps of:
detecting the system clock frequency value F thereby determining a processing rate;
detecting progress in processing the at least one real-time task;
determining an predicted time point T1 from the progress and the processing rate, whereby the system will complete processing the at least one real-time task;
determining a complexity level decrease value CSTEP, whereby according to a complexity level of Cxe2x88x92CSTEP, the system is likely to complete processing the at least one real-time task, when the predicted time point T1, is greater than the time point TE;
setting the complexity value C to be the minimal complexity value CMIN, determining a frequency increase value FSTEP wherein the system will complete processing the at least one real-time task by TE according to a system clock frequency F+FSTEP and a complexity level CMIN and setting the system clock frequency value F to be F+FSTEP, when Cxe2x88x92CSTEP less than CMIN;
setting the complexity value C to be Cxe2x88x92CSTEP when Cxe2x88x92CSTEPxe2x89xa7CMIN; and
repeating from the step of detecting the system clock frequency value F.
According to a further aspect of the invention, the real-time task is operable according to at least two modes of operation. Each of the modes of operation requires a different amount of processing. In this case, the method of the invention the method including the steps of:
determining a selected mode of operation from the at least two modes of operation;
determining a selected system clock frequency value FSELECTED wherein the system will complete processing the at least one real-time task by TE according to a the selected system clock frequency value FSELECTED and the complexity level C; and
setting the system clock frequency value F to be the selected system clock frequency value FSELECTED.
The method of the invention, according to this case, may also include the steps of detecting progress in processing the at least one real-time task;
determining an predicted time point T1 from the progress and the processing rate, whereby the system will complete processing the at least one real-time task;
determining a complexity level decrease value CSTEP, whereby according to a complexity level of Cxe2x88x92CSTEP, the system is likely to complete processing the at least one real-time task, when the predicted time point T1 is greater than the time point TE;
subtracting the complexity level decrease value CSTEP from the complexity level value C and providing the complexity level to the system; and
repeating from the step of detecting the system clock frequency value F.